#唐门优测
#道长最帅666
""

"""
1、if
if语句是用来进行判断的，其使用格式如下：
    if 要判断的条件：
        条件成立时，要做的事情
"""
"例子1"
# age = 30
# print("-----if判断开始-----")
# if age >= 18:
#     print("我已经成年啦，我可以约妹子了！！")
# print("-----if判断结束------")

"例子2"
# age = 30
# print("-----if判断开始-----")
# if age >= 18:
#     print("我已经成年啦，我可以约妹子了！！")
# else:
#     print("还没有成年，不能约妹子！！")
# print("-----if判断结束------")

"例子3"
# score = 66
# if 90 <= score <= 100:
#     print("本次考试，等级为A")
# elif 80 <= score <= 90:
#     print("本次考试，等级为B")
# elif 60 <= score <= 70:
#     print("本次考试，等级为C")
# elif 0 <= score <= 60:
#     print("本次考试，等级为B")
# else:
#     print("666")

"if嵌套"
# age = 19
# girl = True
# if age >= 18:
#     print("我已经成年了，我可以约妹子了")
#     if girl:
#         print("有女朋友，去约会")
#     else:
#         print("没有女朋友，约个P啊")
# else:
#     print("还没有成年，不能约妹子")
#     if girl:
#         print("还没有成年，这是早恋啊")
#     else:
#         print("听话的好孩子")

"while循环"
# i = 0
# while i < 5:
#     print("当前是第%d次执行循环"%(i +1 ))
#     print("i = %d"%i)
#     i += 1

"例子：计算1-100的累积和 包含1和100"
# i = 1
# sum = 0
# while i <= 100:
#     sum = sum + i
#     i += 1
# print("1-100的累积和为：%d"%sum)

"例子：计算1-100偶数的累积和 包含1和100"
# i = 1
# sum = 0
# while i <= 100:
#     if i % 2  ==0:
#         sum = sum + i
#     i += 1
# print("1-100的累积和为：%d"%sum)

"九九乘法表"

# i = 1
# while i < 9:
#     j = 1
#     while j<=i:
#         print("%d*%d=%-2d "%(j,i,i*j),end="")
#         j += 1
#     print("\n")
#     i+=1
"""
1   i =1 j =1
2   ij12   ij 22
"""
#
# for a in range(1, 10):
#     for b in range(1, a + 1):
#         print("{}x{}={}\t".format(a, b, a*b), end="")
#     print()

"for 循环"
"例子1"
# name = "DAOHZANG"
# for x in name:
#     print(x)
"例子2"
# name = ""
# for x in name:
#     print(x)
# else:
#     print("没有数据")

"break"
"for循环"
# name  = "DAOZHANG"
# for x in name:
#     print("-----------")
#     if x == "A":
#         break
#     print(x)

"while循环"
i =0
while i<10:
    i = i+1
    print("--------")
    if i == 5:
        break
    print(i)
"break结束整个循环"
"continue的作用：用来结束本次循环，紧接着执行下一次循环"
